<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="jquery-3.7.1.min.js"></script>

    <style>
        * {
            margin: 0;
            padding: 0;
        }

        .container {
            width: 300px;
            height: 200px;
            border: 2px solid #000;
            margin-left: 100px;
            position: relative;
        }

        .box {
            width: 100px;
            height: 100px;
            padding: 15px;
            background-color: red;
            position: absolute;
            left: 10px;
            top: 10px;
        }
    </style>
</head>

<body>
    <div class="container">
        <div class="box"></div>
    </div>
    <script>
      var offset=$(".box").offset();
      console.log(offset);
      
    </script>
</body>

</html>